import { generateHighlightNodeForSalePrice } from '@/utils/bizUtils';

export const TABLE_COLUMNS = [
  {
    title: '品类树',
    key: 'categoryPath'
  },
  {
    title: '四级类名称',
    key: 'categoryName'
  },
  {
    title: '四级类编码',
    key: 'categoryNo'
  },
  {
    title: '品牌ID',
    key: 'brandUuid'
  },
  {
    title: '品牌名称',
    key: 'brandName'
  },
  {
    title: '系列',
    key: 'seriesName'
  },
  {
    title: '集团售价指导加价率',
    children: [
      { title: '原值', key: 'oldGuideAddRate' },
      {
        title: '现值',
        render: (h, { row }) => generateHighlightNodeForSalePrice(h, row.oldGuideAddRate, row.guideAddRate)
      },
      { title: '调整浮动率', key: 'guideAddRateFloat' },
    ]
  },
  {
    title: '区域标准加价率',
    key: 'areaGuideAddRate'
  },
  {
    title: '指导标准加价率差率',
    key: 'areaGuideAddRateFloat'
  },
  {
    title: '集团畅销加价率',
    children: [
      { title: '原值', key: 'oldSellWellAddRate' },
      {
        title: '现值',
        render: (h, { row }) => generateHighlightNodeForSalePrice(h, row.oldSellWellAddRate, row.sellWellAddRate)
      },
      { title: '调整浮动率', key: 'sellWellAddRateFloat' },
    ]
  },
  {
    title: '区域畅销标准加价率',
    key: 'areaSellWellAddRate'
  },
  {
    title: '畅销指导标准加价率差率',
    key: 'areaSellWellAddRateFloat'
  },
  {
    title: '成交最低加价率',
    children: [
      { title: '原值', key: 'oldLimitAddRate' },
      {
        title: '现值',
        render: (h, { row }) => generateHighlightNodeForSalePrice(h, row.oldLimitAddRate, row.limitAddRate)
      },
      { title: '调整浮动率', key: 'limitAddRateFloat' },
    ]
  },
  {
    title: '区域成交最低加价率',
    key: 'areaLimitAddRate'
  },
  {
    title: '区域集团成交最低加价率差率',
    key: 'areaLimitAddRateFloat'
  },
]

export const FIELDS_ITEMS = [
  { label: '单据号', prop: 'recordNo' },
  { label: '处理状态', prop: 'stateStr' },
  { label: '处理人', prop: 'processUserName' },
  { label: '处理时间', prop: 'processTime' },
  { label: '处理人所属部门', prop: 'processUserDeptName' },
  { label: '处理人所属区域', prop: 'processUserManageAreaName' },
  { label: '审核时间', prop: 'approveTime' },
]
